package com.liuxm.consumer.controller;

import org.feign.client.UserFeignApi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author liuxm
 * @version 1.0
 * @date 2021/3/21 22:29
 */
@RestController
@RequestMapping("consumer")
public class ConsumerController {

    @Autowired
    private UserFeignApi userFeignApi;

    @GetMapping("{username}")
    public Map queyUserByName(@PathVariable("username") String username) {
        return userFeignApi.queyUserByName(username);
    }
}
